//
//  RealTimeSignalCell.m
//  Portable Traffic Signal Assistor
//
//  Created by Hao Xu on 5/14/12.
//  Copyright (c) 2012 TTU. All rights reserved.
//

#import "RealTimeSignalCell.h"

@implementation RealTimeSignalCell
@synthesize signalNameLabel=_signalNameLabel;
@synthesize activePhaseLabel=_activePhaseLabel;
@synthesize nextPhaseLabel=_nextPhaseLabel;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
//    [self ]
    if (self) {
        // Initialization code
//        self.signalNameLabel=[[[UILabel alloc] initWithFrame:CGRectMake(15, 2, 280*2/5-1, 40)] autorelease];
        self.signalNameLabel=[[[UILabel alloc] initWithFrame:CGRectMake(15, 2, 250, 30)] autorelease];
        self.signalNameLabel.backgroundColor=[UIColor whiteColor];
        self.signalNameLabel.numberOfLines=0;
        self.signalNameLabel.lineBreakMode=UILineBreakModeWordWrap;
        UIFont *cellFont = [ UIFont fontWithName: @"Arial" size: 12.0 ];
        self.signalNameLabel.minimumFontSize=5;
//        self.signalNameLabel.font  = cellFont;
        self.signalNameLabel.layer.cornerRadius=8;
        
//        self.activePhaseLabel=[[[UILabel alloc] initWithFrame:CGRectMake(280*2/5+15, 2, 280*2/5-12, 40)] autorelease];
        self.activePhaseLabel=[[[UILabel alloc] initWithFrame:CGRectMake(15, 35, 250, 30)] autorelease];
        self.activePhaseLabel.backgroundColor=[UIColor greenColor];
        self.activePhaseLabel.numberOfLines=0;
        self.activePhaseLabel.lineBreakMode=UILineBreakModeWordWrap;
        self.activePhaseLabel.minimumFontSize=5;
        self.activePhaseLabel.font  = cellFont;
        self.activePhaseLabel.layer.cornerRadius=8;
        
        self.nextPhaseLabel=[[[UILabel alloc] initWithFrame:CGRectMake(280*4/5+3, 2, 280*1/5-13, 40)] autorelease];
        self.nextPhaseLabel.backgroundColor=[UIColor grayColor];
        self.nextPhaseLabel.numberOfLines=0;
        self.nextPhaseLabel.lineBreakMode=UILineBreakModeWordWrap;
        self.nextPhaseLabel.minimumFontSize=5;
        self.nextPhaseLabel.font  = cellFont;
        self.nextPhaseLabel.layer.cornerRadius=8;
        
        [self addSubview:self.signalNameLabel];
        [self addSubview:self.activePhaseLabel];
        [self addSubview:self.nextPhaseLabel];
                               
//                               UILabel *greenLabel = [[[UILabel alloc] initWithFrame:CGRectMake(self.timingRing1GraphPositionX,timingGraphPositionY,greenPhaseLength,timingGraphHeight)] autorelease];] ]
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
